home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d1
/
bmenu54.arc
/
BMENU54.DOC
< prev
next >
Wrap
Text File
|
1990-02-12
|
9KB
|
262 lines
┌─────────────────────────────────────┐
│ ░▒▓█ Batch Menu System █▓▒░ │
│ │
│ Pop up menus │
│ right in your own │
│ batch files! │
│ │
│ BMENU 5.4 2/12/89 │
│ (C) 1990 by Mark Strong │
└─────────────────────────────────────┘
The Batch Menu System allows you to insert pop-up menus within a batch
file.
Similar to the Norton Utilities ASK function, BMENU returns the error-
level of the item selected. BMENU allows the choice of menu location,
title, item list and optionally, color.
For example, the command (using default black and white colors):
bmenu 10 5 Title Choice1 Choice2 Choice3
would produce a menu at row 10, column 5, with title "Title" and three
choices. If the user selects choice 1, the errorlevel return is 1,
choice 2 returns errorlevel 2, and so on. If ESC or ^C (Ctrl-Brk) is
pressed, errorlevel 0 is returned to trap a "no choice made" condition.
You can also use quotes to use multi-word choices:
bmenu 10 5 "My Menu" Choice1 Choice2 "Another Choice"
or use an @file:
bmenu @filename.ext
The @file must have the format of one command line argument per line.
For the last example, filename.ext would contain:
10
5
My Menu
Choice1
Choice2
Another Choice
Several example batch files are included to demonstrate various uses
of Bmenu, including @files and color definitions.
MULTIPLE MENUS:
@file listings may now have multiple menus within a single file. Simply
delimit the menus with the dollar sign ($) and then a label ($mymenu).
Then call bmenu as follows:
bmenu @file mymenu
Bmenu will search the @file until the label is found and read the commands
until the end of file, or the next $ menu is found. If you need to use
the dollar sign in a menu choice, use quotes around the entire choice, and
Bmenu will consider the line an argument rather than a multiple menu
label.
Comments are also allowed. Any line beginning with a colon (;) is ignored
by bmenu.
Example contents of menus.fil:
;
; Example menu file for BMENU 5.4
;
2
50
Title
Choice 1
Choice 2
Choice 3
;
; If the user wishes to have $'s in the menu choices,
; enclose the choice with quotes (but remember, quotes are not a space)
;
$menu2
2
50
Dollar Sign Example
Choice 1
Choice 2
" $Choice 3 "
; Above spacing is necessary to line up C C and $
; because the quote is not a space
"$Choice 4"
; If $ is first on line, OK also
Note that no $ label is used for the first menu, as this is the default
input when an @file is used. If you want to label the first menu, you
must always reference that label in order to use the menu. The above
menus.fil file could be used two ways:
bmenu @menus.fil
or
bmenu @menus.fil menu2
Each of which would access the appropriate menu.
COLOR:
User defined colors are now available on the command line. Simply
follow the row and column numbers with a dash then the window, menu,
and selection bar color numbers, in decimal. For example,
bmenu 10 10 -3 5 65 title choice1 choice2
would produce a cyan border with magenta menu choices and a red bar with
a blue word for the current menu choice. The colors may also be included
in an @file, with the above example being:
10
10
-3
5
65
title
choice1
choice2
The color combinations are made by adding the decimal values of the
foreground and background colors.
┌───────────────────────────────────┐
│ ░▒▓█ Color Attributes █▓▒░ │
└───────────────────────────────────┘
Foreground Colors:
Black 0 Gray 8
Blue 1 Light Blue 9
Green 2 Light Green 10
Cyan 3 Light Cyan 11
Red 4 Light Red 12
Magenta 5 Light Magenta 13
Brown 6 Yellow 14
Light Gray 7 White 15
Background Colors:
Black 0
Blue 16
Green 32
Cyan 48
Red 64
Magenta 80
Brown 96
White 112
NOTES:
Typing `bmenu' alone lists the usage of the program.
Feel free to comment or make suggestions, but if you find the program
useful, please register. I appreciate the distribution via BBS's and
permission is granted to make copies of BMENU for this purpose. Feel
free to distribute the program to friends and others who can make use
of a batch menu system.
With the addition of multiple menu @files, Bmenu has become VERY network
compatible. Try it instead of numerous ECHO statements for menus.
Portions of this program Copyright 1986,1987 New Dimension Software.
Address correspondence to: Mark Strong
6029 Eastridge Lane
Cincinnati, OH 45247
or CompuServe mail [70043,114]
________________________________________________________________________
Update History:
1.0 - original offering, 3/22/89 or so?
2.0 - added color, if you want it, thanks to H. C. Wottle, 5/89
3.0 - changed errorlevel return value so that ESC returns 0,
and choice 1 = errorlevel 1, etc.
Thanks to W. F. Hines, 11/15/89
4.0 - added @file capability, fixed choice handling for consistent
spacing, and cursor size, 12/04/89
5.0 - added optional color definition on the command line, 1/14/90
5.2 - fixed bug in command line @file definition, spotted by T.Scott
1/29/90
5.3 - added optional multi-menu @files, again thanks to T.Scott, 1/31/90
5.4 - Corrected handling of ^C and Ctrl-Brk, 2/12/90
I hope anyone reading this replaces the BMENU, BMENU2-A, BMENU2-B,
BMENU3, BMENU4, and BMENU5 files floating around with this file,
BMENU54.ZIP dated 02/12/90.
Bmenu 5.4
Registration Form
(C) Copyright 1990 by Mark Strong
Name ________________________________
Company ________________________________
Address ________________________________
City, State ________________________________
Zip ________________________________
Where did you obtain this copy of Bmenu 5.4? ________________________________
____________________________________________________________________________
Were you a user of previous Bmenu programs, and if so which version?
___________________________________________________________________________
Comments/Suggestions: ______________________________________________________
____________________________________________________________________________
The cost to register one copy of Bmenu is $10.00. Registration entitles
you to legally continue to use the program, plus written notification of
future versions. For a contribution of $15.00 or more, you receive the above
benefits plus the latest version of Bmenu or the next release, whichever is
applicable, via postage paid first class mail. (Site licenses are also
available, write for info and include expected usage.) Please make checks
payable to Mark Strong, and send to the address listed below.
Thank you for your interest, and for supporting Shareware products.
Please check: Registration ($10) ____ Registration + disk ($15) ______
Site License Info ____ Expected use: _________________
Circle Disk Size (if $15.00 or more) : 5.25 3.5
Additional disks: ____ x $5 = ___________
Total Enclosed: ___________
Please remit to: Mark Strong
6029 Eastridge Lane
Cincinnati, OH 45247